package com.objetdirect.gwt.umldrawer.client;

import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class PrivacyBar{

	private VerticalPanel privacyBar = new VerticalPanel();
	private HorizontalPanel privacyBarContent = new HorizontalPanel();
	private Label copyRight = new Label(); 
	private Hyperlink signIn_ = new Hyperlink("Sign In", "SignIn");
	private Hyperlink signUp_ = new Hyperlink("Sign Up", "SignUp");
	private Hyperlink tutorials_ = new Hyperlink("Tutorials", "Tutorials");
	private Hyperlink samples_ = new Hyperlink("Samples", "Samples");
	private Hyperlink aboutUs_ = new Hyperlink("About Us", "AboutUs");
	private Hyperlink home_ = new Hyperlink("Home", "Home");
	private Hyperlink privacy_ = new Hyperlink("Privacy", "Privacy");
	private Hyperlink terms_ = new Hyperlink("Terms of Use", "TermsOfUse");
	private Hyperlink signOut_ = new Hyperlink("Sign Out", "Home");
	
	public VerticalPanel getprivacyBar () {
		
		copyRight.setText("Copyright (c) 2011 OnlineProfessionalDesignUML! Inc. All rights reserved.");
		
		home_.addStyleName("copyRightButtons");
		signIn_.addStyleName("copyRightButtons");
		signUp_.addStyleName("copyRightButtons");
		tutorials_.addStyleName("copyRightButtons");
		samples_.addStyleName("copyRightButtons");
		aboutUs_.addStyleName("copyRightButtons");
		privacy_.addStyleName("copyRightButtons");
		terms_.addStyleName("copyRightButtons");
		signOut_.addStyleName("copyRightButtons");
		
		privacyBarContent.add(copyRight);
		privacyBarContent.add(home_);
		if (History.getToken().equals("Account")){
			copyRight.setStyleName("copyRightInAccount");
			privacyBarContent.add(signOut_);
		}
		else {
			copyRight.setStyleName("copyRight");
			privacyBarContent.add(signIn_);
			privacyBarContent.add(signUp_);
		}
		privacyBarContent.add(tutorials_);
		privacyBarContent.add(samples_);
		privacyBarContent.add(aboutUs_);
		privacyBarContent.add(privacy_);
		privacyBarContent.add(terms_);
		
		privacyBar.add(privacyBarContent);
		privacyBar.setStyleName("privacyBar");
		
		return privacyBar;
	}
}